package com.shop.dao;

import com.shop.entity.CoinsEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
/**
 * 
 *
 * @author wzby
 * @date 2022-12-02 13:24:15
 */
@Mapper
public interface CoinsMapper {

    @Insert(" insert member_coins (id,qty) values (#{id},#{qty})")
    Integer insert(CoinsEntity entity);


    @Select(" select  *  from  member_coins where id = #{memberId} limit 1")
    CoinsEntity select(Integer memberId);

    @Update(" update member_coins set qty = qty +  #{optionQty} where id = #{memberId}")
    Integer update(Integer memberId,int optionQty);

    @Select(" select  qty  from  member_coins where id = #{memberId} limit 1")
    Integer selectCoinsQty(Integer memberId);
}
